package com.nwpu.coursesupport.mapper;


import com.nwpu.coursesupport.entity.ScoreItemEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author shun
 * @email ws2017303035@mail.nwpu.edu.cn
 * @date 2020-08-04 21:33:50
 */
@Mapper
public interface ScoreItemDao {
    @Insert("insert into score_item values(null,#{finalExamTaskId},#{description},#{fullMark})")
    @Options(keyProperty = "id", keyColumn = "id", useGeneratedKeys = true)
    Integer save(ScoreItemEntity scoreItemEntity);

    @Select("select * from score_item where final_exam_task_id=#{id}")
    List<ScoreItemEntity> findByFinalExamTaskId(@Param("id") Integer id);

    @Delete("delete from score_item where id=#{id}")
    void deleteById(@Param("id")Integer id);
}
